#ifndef ENCODERINTERFACE_H
#define ENCODERINTERFACE_H

#include <QObject>
#include <QStringList>
#include <QPixmap>

#include "encodercodec.h"

class EncoderOption;
class SettingWidgetInterface;


class EncoderInterface: public QObject {
    Q_OBJECT
signals:
    void finished(int);
    void error(int);
    void paused();
    void stopped();

public:
    typedef struct {
	QString name;
	QString displayName;
	QString author;
	QString intro;
	QString site;
    } Infomation;

    typedef struct {
	QStringList fileList;
	QStringList subTitleList;
    } ConvertOption;

    enum ConversionCapability {
	CAP_AUDIO = 0,
	CAP_VIDEO = 1,
	CAP_SUBTITLE = 2
    };

    typedef int TaskId;

public:
    virtual Infomation infomation () const = 0;

    virtual TaskId startConvert (EncoderOption *, ConvertOption * cops = NULL, int * error_code = 0) = 0;
    virtual bool pauseConvert (TaskId) = 0;
    virtual bool cancelConvert (TaskId) = 0;

    virtual SettingWidgetInterface * configWidget (EncoderOption *, ConvertOption * cops = NULL) = 0;

    virtual QList<EncoderCodec *> supportedVideoCodecs () = 0;
    virtual QList<EncoderCodec *> supportedAudioCodecs () = 0;

    virtual QPixmap capturePreview (const QString &file, int offset) = 0;
    virtual int testConversionAvailable (const QString &file) = 0;
};

Q_DECLARE_METATYPE(EncoderInterface::Infomation)

#endif // ENCODERINTERFACE_H
